<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Easy
  </div>
  <div>
   <h1 class="question_title">
    35. Search Insert Position
   </h1>
   <p>
    Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
   </p>
   <p>
    You may assume no duplicates in the array.
   </p>
   <p>
    <strong>
     Example 1:
    </strong>
   </p>
   <pre>
<strong>Input:</strong> [1,3,5,6], 5
<strong>Output:</strong> 2
</pre>
   <p>
    <strong>
     Example 2:
    </strong>
   </p>
   <pre>
<strong>Input:</strong> [1,3,5,6], 2
<strong>Output:</strong> 1
</pre>
   <p>
    <strong>
     Example 3:
    </strong>
   </p>
   <pre>
<strong>Input:</strong> [1,3,5,6], 7
<strong>Output:</strong> 4
</pre>
   <p>
    <strong>
     Example 4:
    </strong>
   </p>
   <pre>
<strong>Input:</strong> [1,3,5,6], 0
<strong>Output:</strong> 0
</pre>
  </div>
  <div>
   <h1 class="question_title">
    35. 搜索插入位置
   </h1>
   <p>
    给定一个排序数组和一个目标值，在数组中找到目标值，并返回其索引。如果目标值不存在于数组中，返回它将会被按顺序插入的位置。
   </p>
   <p>
    你可以假设数组中无重复元素。
   </p>
   <p>
    <strong>
     示例 1:
    </strong>
   </p>
   <pre><strong>输入:</strong> [1,3,5,6], 5
<strong>输出:</strong> 2
</pre>
   <p>
    <strong>
     示例&nbsp;2:
    </strong>
   </p>
   <pre><strong>输入:</strong> [1,3,5,6], 2
<strong>输出:</strong> 1
</pre>
   <p>
    <strong>
     示例 3:
    </strong>
   </p>
   <pre><strong>输入:</strong> [1,3,5,6], 7
<strong>输出:</strong> 4
</pre>
   <p>
    <strong>
     示例 4:
    </strong>
   </p>
   <pre><strong>输入:</strong> [1,3,5,6], 0
<strong>输出:</strong> 0
</pre>
  </div>
 </body>
</html>